import mongoose  from 'mongoose'
import BaseModel from "./base_model"

let Schema    = mongoose.Schema
let ObjectId  = Schema.ObjectId

var ZoneSchema = new Schema({
  appId:            { type: String, requried: true },
  key:              { type: String, requried: true },
  value:            { type: String, requried: true },
  template:         { type: String, requried: true },
  deleted:          { type: Boolean, default: false },
  enable:           { type: Boolean, default: false },
  mustReview:       { type: Boolean, default: false },
  audioAttachment:  { type: Boolean, default: false },
  weight:           { type: Number, default: 0 },
  icon:             { type: String, default: '' },
  createText:       { type: String, default: '新建' },
  create_at:        { type: Date, default: Date.now },
});
ZoneSchema.plugin(BaseModel);
ZoneSchema.index({create_at: -1});

mongoose.model('Zone', ZoneSchema);